<template>
  <!-- Vue3 新特性：允许多个根组件 -->
  <h1>Hello</h1>
  <h2>父组件的钱：{{ money }}</h2>
  <button @click="money += 1000">老爸充钱</button>
  <Son :money="money" @change-money="fn" />
</template>

<script>
  import { ref } from "vue";
  import Son from "./components/Son.vue";

  export default {
    name: "App",
    components: { Son },
    setup() {
      const money = ref(1000);
      const fn = (val) => {
        money.value = val;
      };
      return { money, fn };
    },
  };
</script>
